﻿/**
 * JS常量表
 */
/**
 * 获取 Web应用地址
 */
/**
 * 获取 Web应用地址
 */
function getContextPath() {
	var contextPath = document.location.pathname;
	var index = contextPath.substr(1).indexOf("/");
	contextPath = contextPath.substr(0, index + 1);

	return contextPath;
}

SERVER_HOST_ADDRESS = getContextPath();

/* REST 服务地址 */
REST_SERVICES_ADDRESS = SERVER_HOST_ADDRESS + '/services/';

sps.Constants =
		{
			WEB_COMMAND : SERVER_HOST_ADDRESS + '/command', /* 命令REST服务接口 */
			BIZMODEL : SERVER_HOST_ADDRESS + '/bizmodel', /* 模型REST服务接口 */
			FILE_DOWNLOAD : SERVER_HOST_ADDRESS + '/servlet/file_download', // 文件下载
			WEBFORM : SERVER_HOST_ADDRESS + '/servlet/webform', // 电子表单
			WEBFORM_HANDLER : SERVER_HOST_ADDRESS + '/servlet/webform_handler', // 电子处理服务
			WEBFORM_FILE_UPLOAD : SERVER_HOST_ADDRESS + '/servlet/webform_file_upload', // 电子文件上传
			LD_IMPORT_SERVLET : SERVER_HOST_ADDRESS + '/servlet/sia_import', // 影响场导入
			BLANK_PAGE : SERVER_HOST_ADDRESS + "/blank.html", // 空白页面
			EQ_Plan : SERVER_HOST_ADDRESS + '/servlet/plan',
			RESOURCE_EDITGRID_DELETE : '../theme/default/images/editgrid/delete.gif', // 编辑删除
			RESOURCE_IMG_TRUE : 'resources/theme/default/images/webgrid/true.gif', // 资源
			RESOURCE_IMG_FALSE : 'resources/theme/default/images/webgrid/false.gif', // 资源
			RESOURCE_IMG_CLOSE : 'resources/theme/default/images/webgrid/close.gif', // 资源
			RESOURCE_IMG_EXPAND : 'resources/theme/default/images/webgrid/expand.gif', // 资源

			// 树用到的资源
			RES_TREE_ICON_PATH : SERVER_HOST_ADDRESS + '/resources/tree/',
			RES_TREE_ICON_JOIN : SERVER_HOST_ADDRESS + '/resources/tree/join.gif',
			RES_TREE_ICON_JOIN_BOTTOM : SERVER_HOST_ADDRESS + '/resources/tree/joinbottom.gif',
			RES_TREE_ICON_MINUS : SERVER_HOST_ADDRESS + '/resources/tree/minus.gif',
			RES_TREE_ICON_MINUS_BOTTOM : SERVER_HOST_ADDRESS + '/resources/tree/minusbottom.gif',
			RES_TREE_ICON_PLUS : SERVER_HOST_ADDRESS + '/resources/tree/plus.gif',
			RES_TREE_ICON_PLUS_BOTTOM : SERVER_HOST_ADDRESS + '/resources/tree/plusbottom.gif',
			RES_TREE_ICON_EMPTY : SERVER_HOST_ADDRESS + '/resources/tree/empty.gif',
			RES_TREE_ICON_LINE : SERVER_HOST_ADDRESS + '/resources/tree/line.gif',
			RES_TREE_ICON_LEAF : SERVER_HOST_ADDRESS + '/resources/tree/page.gif',
			RES_TREE_ICON_FOLDER : SERVER_HOST_ADDRESS + '/resources/tree/folder.gif',

			// 通用布尔返回结果
			SUCCESS : 'SUCCESS',
			FAIL : 'FAILURE',

			// oracle 10g 用到的关键字
			ORACLE10G_RESERVED_WORDS : 'ACCESS,ADD,ALL,ALTER,AND,ANY,AS,ASC,AUDIT,BETWEEN,BY,CHAR,CHECK,CLUSTER,COLUMN,COMMENT,COMPRESS,CONNECT,CREATE,CURRENT,DATE,DECIMAL,DEFAULT,DELETE,DESC,DISTINCT,DROP,ELSE,EXCLUSIVE,EXISTS,FILE,FLOAT,FOR,FROM,GRANT,GROUP,HAVING,IDENTIFIED,IMMEDIATE,IN,INCREMENT,INDEX,INITIAL,INSERT,INTEGER,INTERSECT,INTO,IS,LEVEL,LIKE,LOCK,LONG,MAXEXTENTS,MINUS,MLSLABEL,MODE,MODIFY,NOAUDIT,NOCOMPRESS,NOT,NOWAIT,NULL,NUMBER,OF,OFFLINE,ON,ONLINE,OPTION,OR,ORDER,P,CTFREE,PRIOR,PRIVILEGES,PUBLIC,RAW,RENAME,RESOURCE,REVOKE,ROW,ROWID,ROWNUM,ROWS,SELECT,SESSION,SET,SHARE,SIZE,SMALLINT,START,SUCCESSFUL,SYNONYM,SYSDATE,TABLE,THEN,TO,TRIGGER,UID,UNION,UNIQUE,UPDATE,USER,VALIDATE,VALUES,VARCHAR,VARCHAR2,VIEW,WHENEVER,WHERE,WITH',

			// 列表用到的资源
			RES_LIST_ICON_MOVEUP : SERVER_HOST_ADDRESS + '/resources/theme/default/images/form/moveup.png',
			RES_LIST_ICON_MOVEDOWN : SERVER_HOST_ADDRESS + '/resources/theme/default/images/form/movedown.png',
			RES_LIST_ICON_EDIT : SERVER_HOST_ADDRESS + '/resources/theme/default/images/form/edit.png',
			RES_LIST_ICON_DELETE : SERVER_HOST_ADDRESS + '/resources/theme/default/images/form/delete.gif',
			RES_LIST_ICON_BLANK : SERVER_HOST_ADDRESS + '/resources/theme/default/images/form/blank_icon.png',
			RES_LIST_TOOLBAR_ICON_ADD : SERVER_HOST_ADDRESS + '/resources/theme/default/images/form/add.png'
		};